<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="layui/css/layui.css">
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script src="layui/layui.js" charset="utf-8"></script>
<title>电子银行——》内部转账</title>
<script type="text/javascript">
$(function(){
	
	
})
</script>
<script type="text/javascript">
function selectUserIsExistence(value){
	$.post("bank3_2.do",{"rid":value},function(data){
		if (data==1) {
			$("#rid-i").html("√").css("color","green");
		} else {
			$("#rid-i").html("会员不存在或非注册会员").css("color","red");
		}
	})
}

function validationMoney(value){
	var money=${money};
	var moneyout=$("#moneyout").val();
	if (money>=moneyout) {
		$("#money-i").html("√").css("color","green");
	} else {
		$("#money-i").html("余额不足").css("color","red");
	}
}

$(function(){
$("#but1").click(function(){
	var paycode=$("#paycode").val();
	$.post("bank3_3.do",{"paycode":paycode},function(data){
		if (data==1) {
			$('#form1').submit();
			alert("转账成功");
		} else {
			alert("密码错误");
		}
	})
});
})


</script>
</head>

<body class="layui-layout-body">

<form id="form1" action="bank3_4.do" name="form1">
<table width="552" height="231" border="0">
  <tr>
    <td width="163" align="right">当前余额：</td>
    <td width="172" align="left"><input type="text" name="money" id="money" value="${money }" readonly="readonly" style="border: 0px"/></td>
    <td width="219">&nbsp;</td>
  </tr>
  <tr>
    <td align="right">转账目标会员：</td>
    <td align="left"><input type="text" name="rid" id="rid" onblur="selectUserIsExistence(value)"/></td>
    <td><i id="rid-i"></i></td>
  </tr>
  <tr>
    <td align="right">转账金额：</td>
    <td align="left"><input type="text" name="moneyout" id="moneyout" onblur="validationMoney(value)"/></td>
    <td><i id="money-i"></i></td>
  </tr>
  <tr>
    <td align="right">二级密码：</td>
    <td align="left"><input type="password" name="paycode" id="paycode" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<table width="552" height="61" border="0">
  <tr>
    <td width="121" height="55">&nbsp;</td>
    <td width="243" align="center"><input type="button" name="but1" id="but1" value="提交" /></td>
    <td width="166">&nbsp;</td>
  </tr>
</table>

</body>
</html>